// let a = ["zhangsan", "lisi", "wangwu", "zhaoliu"];
// let b = [];
export function filter1(a, callback) {
  let b = [];
  for (let i = 0; i < a.length; i++) {
    let s = callback(a[i]);
    // let s = a[i].startsWith("z");
    if (!s) {
      b.push(a[i]);
    }
  }
  console.log(a);
  console.log(b);
  return b;
}

export let filter2 = function (a) {
  let b = [];
  for (let i = 0; i < a.length; i++) {
    let s = a[i].startsWith("z");
    if (!s) {
      b.push(a[i]);
    }
  }
  console.log(a);
  console.log(b);
  return b;
};

export let filter3 = (a) => {
  let b = [];
  for (let i = 0; i < a.length; i++) {
    let s = a[i].startsWith("z");
    if (!s) {
      b.push(a[i]);
    }
  }
  console.log(a);
  console.log(b);
  return b;
};

// let a = ["zhangsan", "lisi", "wangwu", "zhaoliu"];
// filter1(a);
// filter2(a);
// filter3(a);
